<?php

use yii\db\Migration;

class m170619_032750_create_guild_game extends Migration
{
    public function up()
    {
        $tableOptions = null;
        if ($this->db->driverName === 'mysql') {
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=MyISAM';
        }

        $this->createTable('{{%guild_game}}', [
            'id' => $this->primaryKey()->unsigned()->comment('自增id'),
            'guild_sign' => $this->string()->notNull()->comment('所属公会标识'),
            'game_id' => $this->integer(32)->notNull()->comment('游戏ID'),
        ], $tableOptions);
    }

    public function down()
    {
        $this->dropTable('{{%guild_game}}');
    }
}
